package com.atguigu.gmall.product.service.impl;

import com.atguigu.gmall.model.product.BaseTrademark;
import com.atguigu.gmall.product.mapper.BaseTrademarkMapper;
import com.atguigu.gmall.product.service.TrademarkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author ：MJS
 * @date ：Created in 2021/5/11  9:06
 * @description：TODO
 */
@Service
public class TrademarkServiceImpl implements TrademarkService {
    @Autowired
    private BaseTrademarkMapper baseTrademarkMapper;
    //添加品牌
    @Override
    public void saveTrademark(BaseTrademark baseTrademark) {
        baseTrademarkMapper.insert(baseTrademark);
    }
    //根据id查询品牌
    @Override
    public BaseTrademark getTrademarkById(String id) {
        BaseTrademark baseTrademark = baseTrademarkMapper.selectById(id);
        return baseTrademark;
    }
    //修改品牌
    @Override
    public void updateById(BaseTrademark baseTrademark) {
        baseTrademarkMapper.updateById(baseTrademark);
    }
    //根据id删除品牌
    @Override
    public void remove(Long id) {
        baseTrademarkMapper.deleteById(id);
    }
}
